//
//  MSNetEngine+YMW.m
//  JYG_Agent
//
//  Created by Mike on 15/10/12.
//  Copyright © 2015年 apple. All rights reserved.
//

#import "MSNetEngine+YMW.h"

@implementation MSNetEngine (YMW)

#pragma mark - 启动引导图片
- (void)requestStartImageWithTarget:(id)target hudView:(UIView *)hudView{
    [self GET:[NSString stringWithFormat:AppStartImageUrl,hostUrl] parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseStartImageRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析启动引导图片
-(void)responseStartImageRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"启动引导图片:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        
        NSMutableArray *imageArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = responseDic[@"adsImgs"];
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                propertyPicture *pictureModel = [[propertyPicture alloc] init];
                pictureModel.path = [NSString stringWithFormat:@"%@%@",hostUrl,[HDUtil check:dict[@"imgUrl"]]];
                pictureModel.cateId = [HDUtil check:dict[@"id"]];
                [imageArray addObject:pictureModel];
            }
        }
        [userInfo setObject:imageArray forKey:@"StartImageArray"];
        
        NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES) firstObject];
        NSString *imageFile = [documentsPath stringByAppendingPathComponent:@"StartImageArrayFile.plist"];
        [imageArray writeToFile:imageFile atomically:YES];
        
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 上传图片
- (void)requestUploadImageWithTarget:(id)target hudView:(UIView *)hudView params:(NSArray *)imagesArray{
    [self POST:[NSString stringWithFormat:UploadImageUrl,hostUrl] parameters:nil hudView:hudView constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
        for (int i=0;i<imagesArray.count;i++) {
            UIImage *image = imagesArray[i];
            NSData *imageData = UIImageJPEGRepresentation(image,0.2);
            NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
            formatter.dateFormat = @"yyyyMMddHHmmss";
            NSString *str = [formatter stringFromDate:[NSDate date]];
            NSString *fileName = [NSString stringWithFormat:@"%@%d.jpg",str,i];
            [formData appendPartWithFileData:imageData name:@"file" fileName:fileName mimeType:@"image/jpg"];
        }
    } success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseUploadImageRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析上传图片
-(void)responseUploadImageRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"上传图片:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        
        NSMutableArray *imageArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = [HDUtil checkArray:responseDic[@"images"]];
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                propertyPicture *pictureModel = [[propertyPicture alloc] init];
                pictureModel.path = [HDUtil check:dict[@"url"]];
                pictureModel.cateId = [HDUtil check:dict[@"id"]];
                [imageArray addObject:pictureModel];
            }
        }
        [userInfo setObject:imageArray forKey:@"UploadImage"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 手机号校验
- (void)requestVerifyMobileWithTarget:(id)target hudView:(UIView *)hudView mobile:(NSString *)mobile{
    [self POST:[NSString stringWithFormat:VerifyMobileUrl,hostUrl,mobile] parameters:nil hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseVerifyMobileRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析手机号校验
-(void)responseVerifyMobileRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"VerifyMobile"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
    NSLog(@"手机号校验:%@",responseDic);
    
}

#pragma mark - 注册
- (void)requestRegistWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    [self POST:[NSString stringWithFormat:RegistUrl,hostUrl] parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseRegistRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析注册
-(void)responseRegistRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"注册:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"Regist"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 上传通讯录
- (void)requestUploadContactsWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:UploadContacts,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self POST:urlStr parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseUploadContactsRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析上传通讯录
-(void)responseUploadContactsRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"上传通讯录:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"UploadContactsSuccess"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 未加入好友
- (void)requestUnjoinedFriendsWithTarget:(id)target hudView:(UIView *)hudView{
    NSString *currentStr = [NSString stringWithFormat:UnjoinedFriends,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseUnjoinedFriendsRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析未加入好友
-(void)responseUnjoinedFriendsRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"未加入好友:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSDictionary *valueDict = responseDic[@"phoneBookPage"];
        NSArray *resposeArray;
        if ([valueDict isKindOfClass:[NSDictionary class]]) {
            resposeArray = [HDUtil checkArray:valueDict[@"datas"]];
        }
        for (NSDictionary *dict in resposeArray) {
            SYContacter *contacter = [[SYContacter alloc] init];
            contacter.name = [HDUtil check:dict[@"name"]];
            contacter.phone = [HDUtil check:dict[@"id"]];
            contacter.selected = NO;
            [dataArray addObject:contacter];
        }
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:dataArray forKey:@"UnjoinedFriends"];
        [userInfo setObject:[HDUtil check:responseDic[@"registeredCount"]] forKey:@"registeredCount"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 已加入好友
- (void)requestJoinedFriendsWithTarget:(id)target hudView:(UIView *)hudView{
    NSString *currentStr = [NSString stringWithFormat:JoinedFriends,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseJoinedFriendsRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析已加入好友
-(void)responseJoinedFriendsRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"已加入好友:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSDictionary *valueDict = responseDic[@"phoneBookPage"];
        NSArray *resposeArray;
        if ([valueDict isKindOfClass:[NSDictionary class]]) {
            resposeArray = [HDUtil checkArray:valueDict[@"datas"]];
        }
        for (NSDictionary *dict in resposeArray) {
            SYContacter *contacter = [[SYContacter alloc] init];
            contacter.name = [HDUtil check:dict[@"name"]];
            contacter.phone = [HDUtil check:dict[@"id"]];
            contacter.selected = NO;
            [dataArray addObject:contacter];
        }
        /*
        SYContacter *contacter = [[SYContacter alloc] init];
        contacter.name = @"曹正德";
        [dataArray addObject:contacter];
        
        SYContacter *contacter1 = [[SYContacter alloc] init];
        contacter1.name = @"夏雨";
        [dataArray addObject:contacter1];
        
        SYContacter *contacter2 = [[SYContacter alloc] init];
        contacter2.name = @"才喝";
        [dataArray addObject:contacter2];
        
        SYContacter *contacter3 = [[SYContacter alloc] init];
        contacter3.name = @"张霖";
        [dataArray addObject:contacter3];
        
        SYContacter *contacter4 = [[SYContacter alloc] init];
        contacter4.name = @"王怀";
        [dataArray addObject:contacter4];
        
        SYContacter *contacter5 = [[SYContacter alloc] init];
        contacter5.name = @"李志";
        [dataArray addObject:contacter5];
        */
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:dataArray forKey:@"JoinedFriends"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 邀请好友
- (void)requestInviteFriendsWithTarget:(id)target hudView:(UIView *)hudView params:(NSString *)params{
    NSString *currentStr = [NSString stringWithFormat:InviteFriends,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    NSString *testStr = [NSString stringWithFormat:@"%@?ids=%@",urlStr,params];

    [self POST:testStr parameters:nil hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseInviteFriendsRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析邀请好友
-(void)responseInviteFriendsRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"邀请好友:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"InviteFriends"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 上传名片
- (void)requestUploadCardUrlWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:UploadCardUrl,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
//    [self POST:urlStr parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
//        [self responseUploadCardRequest:responseObject target:target];
//    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//        [self showErrorMessge:error];
//    }];
    
    [self PUT:urlStr parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseUploadCardRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析上传名片
-(void)responseUploadCardRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"上传名片:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"UploadCard"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 登录
- (void)requestLoginWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    [self POST:[NSString stringWithFormat:LoginUrl,hostUrl] parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseLoginRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析登录
-(void)responseLoginRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"登录:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSString *sessionId = [HDUtil check:responseDic[@"jsessionid"]];
        netEngine.sessionId = sessionId;
        
        NSUserDefaults *defaultes = [NSUserDefaults standardUserDefaults];
        [defaultes setObject:@"y" forKey:LoginState];
        [defaultes setObject:sessionId forKey:LoginSessionId];
        [defaultes synchronize];
        
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:[HDUtil check:responseDic[@"jsessionid"]] forKey:@"Login"];
        
        [[NSNotificationCenter defaultCenter] postNotificationName:KLoginSuccess object:self userInfo:userInfo];
        
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"failCode"]]];
    }
}

#pragma mark - 退出登录
- (void)requestLogoutWithTarget:(id)target hudView:(UIView *)hudView{
    NSString *currentStr = [NSString stringWithFormat:LogoutUrl,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseLogoutRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析退出登录
-(void)responseLogoutRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"退出登录:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:[HDUtil check:responseDic[@"Logout"]] forKey:@"Logout"];
        
//        [[NSNotificationCenter defaultCenter] postNotificationName:KLoginSuccess object:self userInfo:userInfo];
        
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"failCode"]]];
    }
}

- (void)requestBaseInfo{
    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES) firstObject];
    
    //区域
    NSString *chinaAreaFile = [documentsPath stringByAppendingPathComponent:@"chinaAreaFile.plist"];
    if ([fileManager fileExistsAtPath:chinaAreaFile]) {
        netEngine.chinaAreaArray = [[NSMutableArray alloc] initWithContentsOfFile:chinaAreaFile];
    }
    if (netEngine.chinaAreaArray.count<1) {
        [netEngine requestChinaAreaWithTarget:nil hudView:nil];
    }
    
    //省市
    NSString *provincesFile = [documentsPath stringByAppendingPathComponent:@"provincesFile.plist"];
    if ([fileManager fileExistsAtPath:provincesFile]) {
        netEngine.provincesArray = [[NSMutableArray alloc] initWithContentsOfFile:provincesFile];
    }
    if (netEngine.provincesArray.count<1) {
        [netEngine requestProvinceAndCityWithTarget:nil hudView:nil];
    }
    
    //阶段
    NSString *projectStateFile = [documentsPath stringByAppendingPathComponent:@"projectStateFile.plist"];
    if ([fileManager fileExistsAtPath:projectStateFile]) {
        netEngine.projectStateArray = [[NSMutableArray alloc] initWithContentsOfFile:projectStateFile];
    }
    if (netEngine.projectStateArray.count<1) {
        [netEngine requestProjectStateWithTarget:nil hudView:nil];
    }
    
    //投资
    NSString *projectInvestmentFile = [documentsPath stringByAppendingPathComponent:@"projectInvestmentFile.plist"];
    if ([fileManager fileExistsAtPath:projectInvestmentFile]) {
        netEngine.projectInvestmentArray = [[NSMutableArray alloc] initWithContentsOfFile:projectInvestmentFile];
    }
    if (netEngine.projectInvestmentArray.count<1) {
        [netEngine requestProjectInvestmentWithTarget:nil hudView:nil];
    }
    
    //时间
    NSString *projectTimeFile = [documentsPath stringByAppendingPathComponent:@"projectTimeFile.plist"];
    if ([fileManager fileExistsAtPath:projectTimeFile]) {
        netEngine.projectTimeArray = [[NSMutableArray alloc] initWithContentsOfFile:projectTimeFile];
    }
    if (netEngine.projectTimeArray.count<1) {
        [netEngine requestProjectTimeWithTarget:nil hudView:nil];
    }
    
    //行业
    NSString *projectIndustryFile = [documentsPath stringByAppendingPathComponent:@"projectIndustryFile.plist"];
    if ([fileManager fileExistsAtPath:projectIndustryFile]) {
        netEngine.projectIndustryArray = [[NSMutableArray alloc] initWithContentsOfFile:projectIndustryFile];
    }
    if (netEngine.projectIndustryArray.count<1) {
        [netEngine requestProjectIndustryWithTarget:nil hudView:nil];
    }
}

#pragma mark - 忘记密码
- (void)requestForgetPasswordWithTarget:(id)target hudView:(UIView *)hudView mobile:(NSString *)mobile{
    [self POST:[NSString stringWithFormat:ForgetPasswordUrl,hostUrl,mobile] parameters:nil hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseForgetPasswordRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析忘记密码
-(void)responseForgetPasswordRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"忘记密码:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"ForgetPassword"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 重置密码
- (void)requestResetPasswordWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    [self PUT:[NSString stringWithFormat:ResetPasswordUrl,hostUrl] parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseResetPasswordRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析重置密码
-(void)responseResetPasswordRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"重置密码:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"ResetPassword"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 我的页面
- (void)requestMinePageWithTarget:(id)target hudView:(UIView *)hudView{
    NSString *currentStr = [NSString stringWithFormat:MinePageUrl,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseMinePageRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析我的页面
-(void)responseMinePageRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"我的页面:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        
        MSUserInfoModel *model = [[MSUserInfoModel alloc]init];
        NSDictionary *leagureDict = responseDic[@"leaguer"];
        if ([leagureDict isKindOfClass:[NSDictionary class]]) {
            model.name = [HDUtil check:leagureDict[@"name"]];
            model.headIcon = [NSString stringWithFormat:@"%@%@",hostUrl,[HDUtil check:leagureDict[@"imgUrl"]]];
            model.company = [HDUtil check:leagureDict[@"company"]];
            model.position = [HDUtil check:leagureDict[@"position"]];
            model.level = [HDUtil check:leagureDict[@"leaguer"]];
        }
        model.tracNum = [HDUtil check:responseDic[@"trackCount"]];
        model.atentionNum = [HDUtil check:responseDic[@"followCount"]];
        model.tradeNum = [HDUtil check:responseDic[@"dealCount"]];
        model.footNum = [HDUtil check:responseDic[@"projectFootprintCount"]];
        model.coinNum = [HDUtil check:responseDic[@"wallet"]];

        [userInfo setObject:model forKey:@"MinePage"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 用户信息
- (void)requestUserInfoWithTarget:(id)target hudView:(UIView *)hudView{
    NSString *currentStr = [NSString stringWithFormat:UserInfoUrl,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseUserInfoRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析用户信息
-(void)responseUserInfoRequest:(NSDictionary *)dataDic target:(id)target{
    if (![dataDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"用户信息:%@",dataDic);
    NSString *state = [HDUtil check:dataDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        NSDictionary *responseDic = dataDic[@"leaguer"];
        
        MSUserInfoModel *model = [[MSUserInfoModel alloc]init];
        model.headIcon =  [NSString stringWithFormat:@"%@%@",hostUrl,[HDUtil check:responseDic[@"imgUrl"]]];
        model.name = [HDUtil check:responseDic[@"name"]];
        model.company = [HDUtil check:responseDic[@"company"]];
        model.position = [HDUtil check:responseDic[@"position"]];
        model.level = [HDUtil check:responseDic[@"level"]];
        model.department = [HDUtil check:responseDic[@"department"]];
        model.email = [HDUtil check:responseDic[@"email"]];
        model.internet = [HDUtil check:responseDic[@"website"]];
        model.address = [HDUtil check:responseDic[@"companyAddr"]];
        
        model.societyNum = [HDUtil check:responseDic[@"id"]];
        model.telephone = [HDUtil check:responseDic[@"mobile"]];
        
        [userInfo setObject:model forKey:@"UserInfo"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:dataDic[@"msg"]]];
    }
}

#pragma mark - 修改头像
- (void)requestModifyHeadImageWithTarget:(id)target hudView:(UIView *)hudView params:(NSString *)params{
    NSString *currentStr = [NSString stringWithFormat:ModifyHeadImage,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    NSString *testStr = [NSString stringWithFormat:@"%@?portraitImgId=%@",urlStr,params];
    [self PUT:testStr parameters:nil hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseModifyHeadImageRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析修改头像
-(void)responseModifyHeadImageRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"修改头像:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"ModifyHeadImage"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 账单列表
- (void)requestAccountListWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:AccountList,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:params hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseAccountListRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"AccountList" forKey:@"AccountList"];

        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析账单列表
-(void)responseAccountListRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"账单列表:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        
        NSDictionary *valueDic = responseDic[@"walletRecordPage"];
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = [HDUtil checkArray:valueDic[@"datas"]];
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSCommonModel *model = [[MSCommonModel alloc] init];
                NSString *timeStr = [HDUtil formatter:@"YYYY.MM.dd" FromeDateStr:[HDUtil check:dict[@"createDate"]]];
                model.type = [HDUtil check:dict[@"type"]];
                model.title = [HDUtil check:dict[@"remark"]];
                model.subTitle = timeStr;     //时间
                model.thirdTitle = [HDUtil check:dict[@"price"]];
                [dataArray addObject:model];
            }
        }
        [userInfo setObject:[HDUtil check:valueDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:valueDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"AccountList"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 钱包
- (void)requestWalletWithTarget:(id)target hudView:(UIView *)hudView{
    NSString *currentStr = [NSString stringWithFormat:Wallet,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseWalletRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析钱包
-(void)responseWalletRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"钱包:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:[HDUtil check:responseDic[@"wallet"]] forKey:@"Wallet"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 会员服务
- (void)requestMemberServeWithTarget:(id)target hudView:(UIView *)hudView{
    NSString *currentStr = [NSString stringWithFormat:MemberServe,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseMemberServeRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析会员服务
-(void)responseMemberServeRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"会员服务:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        NSDictionary *dict = responseDic[@"leaguer"];
        if ([dict isKindOfClass:[NSDictionary class]]) {
            MSMemberServeModel *model = [[MSMemberServeModel alloc] init];
            model.day = [HDUtil check:dict[@"restTime"]];
            model.level = [HDUtil check:dict[@"level"]];
            model.wallet = [HDUtil check:dict[@"wallet"]];
            [userInfo setObject:model forKey:@"MemberServe"];
            [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
        }
        
//        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
//        NSArray *tempArray = [HDUtil checkArray:responseDic[@"leaguer"]];
//        for (NSDictionary *dict in tempArray ) {
//            if ([dict isKindOfClass:[NSDictionary class]]) {
//                MSCommonModel *model = [[MSCommonModel alloc] init];
//                model.title = [HDUtil check:dict[@"remark"]];
//                model.subTitle = [HDUtil check:dict[@"price"]];     //时间
//                model.thirdTitle = [HDUtil check:dict[@"price"]];
//                [dataArray addObject:model];
//            }
//        }
//        model.array = dataArray;
        
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 会员购买
- (void)requestMemberPurchaseWithTarget:(id)target hudView:(UIView *)hudView day:(NSString *)day{//days=
    NSString *sessionid = [NSString stringWithFormat:@";jsessionid=%@",netEngine.sessionId];
    NSString *currentStr = [NSString stringWithFormat:MemberPurchase,hostUrl,sessionid];
    NSString *urlStr = [NSString stringWithFormat:@"%@?days=%@",currentStr,day];
    [self POST:urlStr parameters:nil hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseMemberPurchaseRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析会员购买
-(void)responseMemberPurchaseRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"会员购买:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
                [userInfo setObject:@"MemberPurchase" forKey:@"MemberPurchase"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 客户匹配
- (void)requestCustomerMatchingWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:CustomerMatching,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:params hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseCustomerMatchingRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"CustomerMatching" forKey:@"CustomerMatching"];

        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析客户匹配
-(void)responseCustomerMatchingRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"客户匹配:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSDictionary *valueDic = responseDic[@"phoneBookMatchPage"];

        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = [HDUtil checkArray:valueDic[@"datas"]];
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSDetailContactModel *model = [[MSDetailContactModel alloc] init];
                model.name = [HDUtil check:dict[@"name"]];
                model.position = [HDUtil check:dict[@"position"]];
                model.company = [HDUtil check:dict[@"company"]];
                model.telephone = [HDUtil check:dict[@"mobile"]];
                model.source = [HDUtil check:dict[@"projectNames"]];
                [dataArray addObject:model];
            }
        }
        MSDetailContactModel *model = [[MSDetailContactModel alloc] init];
        model.name = @"班辉";
        model.position = @"项目经理";
        model.company = @"上海电力有限公司";
        model.telephone = @"18754486786";
        model.source = @"上海市宝山区友谊路89号";
        
        MSDetailContactModel *model2 = [[MSDetailContactModel alloc] init];
        model2.name = @"王海峰";
        model2.position = @"项目经理";
        model2.company = @"上海电力有限公司";
        model2.telephone = @"18754486786";
        model2.source = @"上海市宝山区友谊路89号";
        
        MSDetailContactModel *model3 = [[MSDetailContactModel alloc] init];
        model3.name = @"巴德";
        model3.position = @"项目经理";
        model3.company = @"上海电力有限公司";
        model3.telephone = @"18754486786";
        model3.source = @"上海市宝山区友谊路89号";
        
        MSDetailContactModel *model4 = [[MSDetailContactModel alloc] init];
        model4.name = @"李志";
        model4.position = @"项目经理";
        model4.company = @"上海电力有限公司";
        model4.telephone = @"18754486786";
        model4.source = @"上海市宝山区友谊路89号";
        
        [dataArray addObject:model];
        [dataArray addObject:model2];
        [dataArray addObject:model3];
        [dataArray addObject:model4];
        [dataArray addObject:model2];
        
        [userInfo setObject:[HDUtil check:valueDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:valueDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"CustomerMatching"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 联系人变更
- (void)requestContactsChangeWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ContactsChange,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self POST:urlStr parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseContactsChangeRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析联系人变更
-(void)responseContactsChangeRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"联系人变更:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"ContactsChange"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 项目更新
- (void)requestProjectUpdateWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ProjectUpdate,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self POST:urlStr parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseProjectUpdateRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析项目更新
-(void)responseProjectUpdateRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"项目更新:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"ProjectUpdate"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 项目通知
- (void)requestProjectNotifacationWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ProjectNotifacation,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:params hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseProjectNotifacationRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ProjectNotifacation" forKey:@"ProjectNotifacation"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析项目通知
-(void)responseProjectNotifacationRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"项目通知:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSDictionary *valueDic = responseDic[@"msgPage"];
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = [HDUtil checkArray:valueDic[@"datas"]];
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSCommonModel *model = [[MSCommonModel alloc] init];
                NSString *timeStr = [HDUtil formatter:@"YYYY.MM.dd" FromeDateStr:[HDUtil check:dict[@"createDate"]]];
                model.title = [HDUtil check:dict[@"name"]];
                model.subTitle = [HDUtil check:dict[@"remark"]];
                model.thirdTitle = timeStr;
                [dataArray addObject:model];
            }
        }
        [userInfo setObject:[HDUtil check:valueDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:valueDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"ProjectNotifacation"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 我的足迹
- (void)requestMyFootWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:MyFoot,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:params hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseMyFootRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"MyFoot" forKey:@"MyFoot"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析我的足迹
-(void)responseMyFootRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"我的足迹:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSDictionary *valueDic = responseDic[@"projectFootprintPage"];
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = [HDUtil checkArray:valueDic[@"datas"]];
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSFootprintModel *model = [[MSFootprintModel alloc] init];
                model.itemID = [HDUtil check:dict[@"id"]];
                model.name = [HDUtil check:dict[@"leaguerName"]];
                model.memberLevel = [HDUtil check:dict[@"name"]];
                model.time = [HDUtil check:dict[@"name"]];
                model.introduction = [HDUtil check:dict[@"content"]];
                model.goodNum = [HDUtil check:dict[@"name"]];
                model.badNum = [HDUtil check:dict[@"name"]];
                NSDictionary *supportDict = dict[@"footprintSupport"];
                if ([supportDict isKindOfClass:[NSDictionary class]]){
                    model.isGoodEd = [[HDUtil check:supportDict[@"support"]] isEqualToString:@"1"];
                    model.isBadEd = [[HDUtil check:supportDict[@"unsupport"]] isEqualToString:@"1"];
                }
                model.isSelf = [[HDUtil check:dict[@"self"]] boolValue];
                
                NSMutableArray* bannerArray = [[NSMutableArray alloc] initWithCapacity:0];
                NSArray *imagearray = [HDUtil checkArray:dict[@"imgs"]];
                for (NSDictionary *imagedict in imagearray) {
                    if ([imagedict isKindOfClass:[NSDictionary class]]){
                        propertyPicture* item = [[propertyPicture alloc] init];
                        item.path = [NSString stringWithFormat:@"%@%@",hostUrl,[HDUtil check:imagedict[@"url"]]];
                        item.cateId =  [HDUtil check:imagedict[@"id"]];
                        [bannerArray addObject:item];
                    }
                }
                model.imageArray = bannerArray;
                
                [dataArray addObject:model];
            }
        }
        [userInfo setObject:[HDUtil check:valueDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:valueDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"MyFoot"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 我的跟踪
- (void)requestMyTrackWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:MyTrack,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:params hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseMyTrackRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"MyTrack" forKey:@"MyTrack"];

        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析我的跟踪
-(void)responseMyTrackRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"我的跟踪:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSDictionary *valueDic = responseDic[@"projectPage"];
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = [HDUtil checkArray:valueDic[@"datas"]];
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSProjectModel *model = [[MSProjectModel alloc] init];
                model.itemID = [HDUtil check:dict[@"id"]];
                model.title = [HDUtil check:dict[@"name"]];
                model.projectType = [HDUtil check:dict[@"industryName"]];
                model.projectState = [HDUtil check:dict[@"stageName"]];
                model.investment = [HDUtil check:dict[@"investment"]];
                model.address = [HDUtil check:dict[@"cityName"]];
                NSString *timeStr = [HDUtil formatter:@"YYYY.MM.dd" FromeDateStr:[HDUtil check:dict[@"createDate"]]];
                model.time = timeStr;
                model.introduction = [HDUtil check:dict[@"summary"]];
                
                [dataArray addObject:model];
            }
        }
        [userInfo setObject:[HDUtil check:valueDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:valueDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"MyTrack"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 我的关注
- (void)requestMyAttentionWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:MyAttention,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:params hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseMyAttentionRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"MyAttention" forKey:@"MyAttention"];

        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析我的关注
-(void)responseMyAttentionRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"我的关注:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSDictionary *valueDic = responseDic[@"projectPage"];
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = [HDUtil checkArray:valueDic[@"datas"]];
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSProjectModel *model = [[MSProjectModel alloc] init];
                model.itemID = [HDUtil check:dict[@"id"]];
                model.title = [HDUtil check:dict[@"name"]];
                model.projectType = [HDUtil check:dict[@"industryName"]];
                model.projectState = [HDUtil check:dict[@"stageName"]];
                model.investment = [HDUtil check:dict[@"investment"]];
                model.address = [HDUtil check:dict[@"cityName"]];
                NSString *timeStr = [HDUtil formatter:@"YYYY.MM.dd" FromeDateStr:[HDUtil check:dict[@"createDate"]]];
                model.time = timeStr;
                model.introduction = [HDUtil check:dict[@"summary"]];
                
                [dataArray addObject:model];
            }
        }
        [userInfo setObject:[HDUtil check:valueDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:valueDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"MyAttention"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

//@{@"jsessionid":netEngine.sessionId}
#pragma mark - 中国区域
- (void)requestChinaAreaWithTarget:(id)target hudView:(UIView *)hudView{
    NSString *currentStr = [NSString stringWithFormat:ChinaArea,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseChinaAreaRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析中国区域
-(void)responseChinaAreaRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"中国区域:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        NSMutableArray *chinaAreaArray = [NSMutableArray arrayWithCapacity:0];

        NSArray *tempAreaArray = [HDUtil checkArray:responseDic[@"zones"]];
        for (NSDictionary *dict in tempAreaArray) {
            NSMutableArray *dasheng = [NSMutableArray arrayWithCapacity:0];
            NSArray *array = [HDUtil checkArray:dict[@"provinceList"]];
            for (NSDictionary *dict2 in array) {
                NSDictionary *dataDict2 = @{@"name":[HDUtil check:dict2[@"name"]],@"code":[HDUtil check:dict2[@"code"]]};
                [dasheng addObject:dataDict2];
            }
            NSDictionary *dataDict = @{@"name":[HDUtil check:dict[@"name"]],@"code":[HDUtil check:dict[@"code"]],@"provinceList":dasheng};
            [chinaAreaArray addObject:dataDict];
        }
        [userInfo setObject:chinaAreaArray forKey:@"ChinaArea"];
        
        self.chinaAreaArray = chinaAreaArray;
        
        NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES) firstObject];
        NSString *chinaAreaFile = [documentsPath stringByAppendingPathComponent:@"chinaAreaFile.plist"];
        [chinaAreaArray writeToFile:chinaAreaFile atomically:YES];
        
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 省市
- (void)requestProvinceAndCityWithTarget:(id)target hudView:(UIView *)hudView{
    NSString *currentStr = [NSString stringWithFormat:ProvinceAndCity,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseProvinceAndCityRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析省市
-(void)responseProvinceAndCityRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"省市:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        
        NSArray *provincesArray = [HDUtil checkArray:responseDic[@"provinces"]];
        [userInfo setObject:provincesArray forKey:@"ProvinceAndCity"];
        self.provincesArray = provincesArray;
        NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES) firstObject];
        NSString *provincesFile = [documentsPath stringByAppendingPathComponent:@"provincesFile.plist"];
        [provincesArray writeToFile:provincesFile atomically:YES];
        
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 项目阶段
- (void)requestProjectStateWithTarget:(id)target hudView:(UIView *)hudView{
    [self GET:[NSString stringWithFormat:ProjectState,hostUrl] parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseProjectStateRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析项目阶段
-(void)responseProjectStateRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"项目阶段:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        
        NSArray *stagesArray = [HDUtil checkArray:responseDic[@"stages"]];
        [userInfo setObject:stagesArray forKey:@"ProjectState"];
        self.projectStateArray = stagesArray;
        
        NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES) firstObject];
        NSString *projectStateFile = [documentsPath stringByAppendingPathComponent:@"projectStateFile.plist"];
        [stagesArray writeToFile:projectStateFile atomically:YES];
        
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 项目投资
- (void)requestProjectInvestmentWithTarget:(id)target hudView:(UIView *)hudView{
    [self GET:[NSString stringWithFormat:ProjectInvestment,hostUrl] parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseProjectInvestmentRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析项目投资
-(void)responseProjectInvestmentRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"项目投资:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        
        NSArray *investmentsArray = [HDUtil checkArray:responseDic[@"investments"]];
        [userInfo setObject:investmentsArray forKey:@"ProjectInvestment"];
        self.projectInvestmentArray = investmentsArray;
        
        NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES) firstObject];
        NSString *projectInvestmentFile = [documentsPath stringByAppendingPathComponent:@"projectInvestmentFile.plist"];
        [investmentsArray writeToFile:projectInvestmentFile atomically:YES];
        
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 项目时间
- (void)requestProjectTimeWithTarget:(id)target hudView:(UIView *)hudView{
    [self GET:[NSString stringWithFormat:ProjectTime,hostUrl] parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseProjectTimeRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析项目时间
-(void)responseProjectTimeRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"项目时间:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        NSArray *timeArray = [HDUtil checkArray:responseDic[@"onlineTimes"]];
        [userInfo setObject:timeArray forKey:@"ProjectTime"];
        self.projectTimeArray = timeArray;
        
        NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES) firstObject];
        NSString *projectTimeFile = [documentsPath stringByAppendingPathComponent:@"projectTimeFile.plist"];
        [timeArray writeToFile:projectTimeFile atomically:YES];
        
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 项目行业
- (void)requestProjectIndustryWithTarget:(id)target hudView:(UIView *)hudView{
    [self GET:[NSString stringWithFormat:ProjectIndustry,hostUrl] parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseProjectIndustryRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析项目行业
-(void)responseProjectIndustryRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"项目行业:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        
        NSArray *industrysArray = [HDUtil checkArray:responseDic[@"industrys"]];
        [userInfo setObject:industrysArray forKey:@"ProjectIndustry"];
        self.projectIndustryArray = industrysArray;
        
        NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES) firstObject];
        NSString *projectIndustryFile = [documentsPath stringByAppendingPathComponent:@"projectIndustryFile.plist"];
        [industrysArray writeToFile:projectIndustryFile atomically:YES];
        
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 项目列表
- (void)requestProjectListWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ProjectList,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    
    [self GET:urlStr parameters:params hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseProjectListRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ProjectList" forKey:@"ProjectList"];

        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析项目列表
-(void)responseProjectListRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
//    NSLog(@"项目列表:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSDictionary *dataDict = responseDic[@"projectPage"];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = [HDUtil checkArray:dataDict[@"datas"]];
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSProjectModel *model = [[MSProjectModel alloc] init];
                model.itemID = [HDUtil check:dict[@"id"]];
                model.title = [HDUtil check:dict[@"name"]];
                model.projectType = [HDUtil check:dict[@"industryName"]];
                model.projectState = [HDUtil check:dict[@"stageName"]];
                model.investment = [HDUtil check:dict[@"investment"]];
                model.address = [HDUtil check:dict[@"cityName"]];
                NSString *timeStr = [HDUtil formatter:@"YYYY.MM.dd" FromeDateStr:[HDUtil check:dict[@"createDate"]]];
                model.time = timeStr;
                model.introduction = [HDUtil check:dict[@"summary"]];
                
                [dataArray addObject:model];
            }
        }
        [userInfo setObject:[HDUtil check:dataDict[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:dataDict[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"ProjectList"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 项目搜索联想
- (void)requestProjectSearchRelevanceWithTarget:(id)target hudView:(UIView *)hudView keyword:(NSString *)keyword params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ProjectSearchRelevance,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:params hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseProjectSearchRelevanceRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ProjectSearchRelevance" forKey:@"ProjectSearchRelevance"];

        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析项目搜索联想
-(void)responseProjectSearchRelevanceRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"项目搜索联想:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
//        NSDictionary *dataDict = responseDic[@"projects"];
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = [HDUtil checkArray:responseDic[@"projects"]];

        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSProjectModel *model = [[MSProjectModel alloc] init];
                model.itemID = [HDUtil check:dict[@"id"]];
                model.title = [HDUtil check:dict[@"name"]];
                model.projectType = [HDUtil check:dict[@"industryName"]];
                model.projectState = [HDUtil check:dict[@"stageName"]];
                model.investment = [HDUtil check:dict[@"investment"]];
                model.address = [HDUtil check:dict[@"address"]];
                model.time = [HDUtil check:dict[@"buildDateStart"]];
                model.introduction = [HDUtil check:dict[@"summary"]];
                
                [dataArray addObject:model];
            }
        }
        [userInfo setObject:[HDUtil check:responseDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:responseDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"ProjectSearchRelevance"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 关注项目
- (void)requestAttentionProjectWithTarget:(id)target hudView:(UIView *)hudView projectId:(NSString *)projectId{
    [self PUT:[NSString stringWithFormat:AttentionProject,hostUrl,projectId] parameters:nil hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseAttentionProjectRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析关注项目
-(void)responseAttentionProjectRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"关注项目:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"AttentionProject"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 跟踪项目
- (void)requestTrackProjectWithTarget:(id)target hudView:(UIView *)hudView projectId:(NSString *)projectId{
    [self PUT:[NSString stringWithFormat:TrackProject,hostUrl,projectId] parameters:nil hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseTrackProjectRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析跟踪项目
-(void)responseTrackProjectRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"跟踪项目:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"TrackProject"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 项目信息
- (void)requestProjectInfoWithTarget:(id)target hudView:(UIView *)hudView projectId:(NSString *)projectId{
    NSString *currentStr = [NSString stringWithFormat:ProjectInfo,hostUrl,projectId];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseProjectInfoRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析项目信息
-(void)responseProjectInfoRequest:(NSDictionary *)valueDic target:(id)target{
    if (![valueDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"项目信息:%@",valueDic);
    NSString *state = [HDUtil check:valueDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        NSDictionary *responseDic = valueDic[@"project"];
        if ([responseDic isKindOfClass:[NSDictionary class]]) {
            MSProjectModel *model = [[MSProjectModel alloc] init];
            model.title = [HDUtil check:responseDic[@"name"]];
            model.projectType = [HDUtil check:responseDic[@"industryName"]];
            model.projectState = [HDUtil check:responseDic[@"stageName"]];
            model.projectArea = [HDUtil check:responseDic[@"cityName"]];
            
            NSString *timeStr = [HDUtil formatter:@"YYYY.MM.dd" FromeDateStr:[HDUtil check:responseDic[@"createDate"]]];
            NSString *timeStartStr = [HDUtil formatter:@"YYYY.MM.dd" FromeDateStr:[HDUtil check:responseDic[@"buildDateStart"]]];
            NSString *timeEndStr = [HDUtil formatter:@"YYYY.MM.dd" FromeDateStr:[HDUtil check:responseDic[@"buildDateEnd"]]];
            model.time = timeStr;
            model.projectPeriod =  [NSString stringWithFormat:@"%@-%@",timeStartStr,timeEndStr];
            model.investment = [HDUtil check:responseDic[@"investment"]];
            model.address = [HDUtil check:responseDic[@"address"]];
            model.introduction = [HDUtil check:responseDic[@"summary"]];
            model.isTrack = [[HDUtil check:responseDic[@"track"]] boolValue];
            model.isAttention = [[HDUtil check:responseDic[@"follow"]] boolValue];
            [userInfo setObject:model forKey:@"ProjectInfo"];
            [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
        }
    }
    else{
        [HDUtil showMessage:[HDUtil check:valueDic[@"msg"]]];
    }
}

#pragma mark - 项目动态
- (void)requestProjectDynamicWithTarget:(id)target hudView:(UIView *)hudView projectId:(NSString *)projectId params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ProjectDynamic,hostUrl,projectId];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseProjectDynamicRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
//        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
//        [userInfo setObject:@"ProjectDynamic" forKey:@"ProjectDynamic"];
//        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析项目动态
-(void)responseProjectDynamicRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"项目动态:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        
        NSDictionary *valueDic = responseDic[@"projectDynamicsPage"];
        if ([valueDic isKindOfClass:[NSDictionary class]]){
            NSArray *tempArray = [HDUtil checkArray:valueDic[@"datas"]];
            for (NSDictionary *dict in tempArray ) {
                if ([dict isKindOfClass:[NSDictionary class]]) {
                    MSProjectDynamicModel *dynamicodel = [[MSProjectDynamicModel alloc] init];
                    dynamicodel.title = [HDUtil check:dict[@"name"]];
                    dynamicodel.time = [HDUtil check:dict[@"createDate"]];
                    dynamicodel.brief = [HDUtil check:dict[@"remark"]];
                    dynamicodel.type = [HDUtil check:dict[@"leaguerName"]];
                    dynamicodel.memberLevel = [HDUtil check:dict[@"bonusPoint"]];
                    
                    [dataArray addObject:dynamicodel];
                }
            }
            /*
            MSProjectDynamicModel *dynamicodel = [[MSProjectDynamicModel alloc] init];
            dynamicodel.title = @"项目动态更新了";
            dynamicodel.time =  @"2016-5-23 12:23:34";
            dynamicodel.brief =  @"机电标已经发标书，共分两个包，投标截止日期，8月8日-11月26日";
            dynamicodel.type =  @"[匿名会员]";
            dynamicodel.memberLevel =  @"1";
            
            MSProjectDynamicModel *dynamicodel1 = [[MSProjectDynamicModel alloc] init];
            dynamicodel1.title = @"项目动态更新了";
            dynamicodel1.time =  @"2017-1-2 12:23:34";
            dynamicodel1.brief =  @"机电标已经发标书，共分两个包，投标截止日期，8月8日-11月26日";
            dynamicodel1.type =  @"[匿名会员]";
            dynamicodel1.memberLevel =  @"2";
            
            MSProjectDynamicModel *dynamicodel2 = [[MSProjectDynamicModel alloc] init];
            dynamicodel2.title = @"上海浦东世和空港中心商业住房项目";
            dynamicodel2.time =  @"2017-1-23 12:23:34";
            dynamicodel2.brief =  @"主体施工";
            dynamicodel2.type =  @"[系统录入]";
            dynamicodel2.memberLevel =  @"1";
            
            [dataArray addObject:dynamicodel];
            [dataArray addObject:dynamicodel2];
            [dataArray addObject:dynamicodel1];
            [dataArray addObject:dynamicodel2];
            [dataArray addObject:dynamicodel];
            */
            [userInfo setObject:[HDUtil check:responseDic[@"pageNo"]] forKey:@"pageNo"];
            [userInfo setObject:[HDUtil check:responseDic[@"totalPage"]] forKey:@"totalPage"];
            [userInfo setObject:dataArray forKey:@"ProjectDynamic"];
            [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
        }
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 项目联系人
- (void)requestProjectContactsWithTarget:(id)target hudView:(UIView *)hudView projectId:(NSString *)projectId params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ProjectContacts,hostUrl,projectId];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseProjectContactsRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ProjectContacts" forKey:@"ProjectContacts"];

        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析项目联系人
-(void)responseProjectContactsRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"项目联系人:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSMutableArray *section1Array = [[NSMutableArray alloc] initWithCapacity:0];
        NSMutableArray *section2Array = [[NSMutableArray alloc] initWithCapacity:0];
        NSMutableArray *section3Array = [[NSMutableArray alloc] initWithCapacity:0];
        
        NSDictionary *valueDic = responseDic[@"projectContactsPage"];
        NSArray *tempArray = [HDUtil checkArray:valueDic[@"datas"]];
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSDetailContactModel *model = [[MSDetailContactModel alloc] init];
                model.peopleId = [HDUtil check:dict[@"id"]];
                model.contactType = [HDUtil check:dict[@"typeName"]];
                model.name = [HDUtil check:dict[@"name"]];
                model.position = [HDUtil check:dict[@"position"]];
                model.company = [HDUtil check:dict[@"company"]];
                model.telephone = [HDUtil check:dict[@"mobile"]];
                model.address = [HDUtil check:dict[@"address"]];
                model.isSaling = [[HDUtil check:dict[@"createdInMonth"]] boolValue];
                if (!model.position.length) {
                    model.position = @"- - -";
                }
                if (!model.company.length) {
                    model.company = @"- - -";
                }
                if (!model.telephone.length) {
                    model.telephone = @"- - -";
                }
                if (!model.address.length) {
                    model.address = @"- - -";
                }
                
                NSString *source = [HDUtil check:dict[@"source"]];
                if ([source isEqualToString:@"leaguer"]) {
                    model.source = @"会员";
                }else{
                    model.source = @"平台采集";
                }
                NSString *timeStr = [HDUtil formatter:@"MM.dd" FromeDateStr:[HDUtil check:dict[@"createDate"]]];
                model.time = timeStr;
                model.otherProject = [HDUtil check:dict[@"saleUserCount"]];

                if ([model.contactType rangeOfString:@"业主"].location != NSNotFound) {
                    [section1Array addObject:model];
                }
                if ([model.contactType rangeOfString:@"设计"].location != NSNotFound) {
                    [section2Array addObject:model];
                }
                if ([model.contactType rangeOfString:@"施工"].location != NSNotFound) {
                    [section3Array addObject:model];
                }
            }
        }
        [dataArray addObject:section1Array];
        [dataArray addObject:section2Array];
        [dataArray addObject:section3Array];
        
        [userInfo setObject:[HDUtil check:valueDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:valueDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"ProjectContacts"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 联系人其他项目
- (void)requestContactsOtherProjectWithTarget:(id)target hudView:(UIView *)hudView contactsId:(NSString *)contactsId params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ContactsOtherProject,hostUrl,contactsId];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:params hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseContactsOtherProjectRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
//        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
//        [userInfo setObject:@"ContactsOtherProject" forKey:@"ContactsOtherProject"];
//
//        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析联系人其他项目
-(void)responseContactsOtherProjectRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"联系人其他项目:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        
        NSArray *tempArray = [HDUtil checkArray:responseDic[@"datas"]];
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSProjectModel *model = [[MSProjectModel alloc] init];
                model.itemID = [HDUtil check:dict[@"id"]];
                model.title = [HDUtil check:responseDic[@"name"]];
                model.projectType = [HDUtil check:responseDic[@"position"]];
                model.projectArea = [HDUtil check:responseDic[@"cityName"]];
                model.projectState = [HDUtil check:responseDic[@"stageName"]];
                model.investment = [HDUtil check:responseDic[@"investment"]];
                NSString *timeStr = [HDUtil formatter:@"YYYY.MM.dd" FromeDateStr:[HDUtil check:dict[@"createDate"]]];
                model.time = timeStr;
                
                [dataArray addObject:model];
            }
        }
        [userInfo setObject:[HDUtil check:responseDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:responseDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"ContactsOtherProject"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 可能认识的人
- (void)requestMayKnowPersonWithTarget:(id)target hudView:(UIView *)hudView contactsId:(NSString *)contactsId{
    [self GET:[NSString stringWithFormat:MayKnowPerson,hostUrl,contactsId] parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseMayKnowPersonRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析可能认识的人
-(void)responseMayKnowPersonRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"可能认识的人:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = [HDUtil checkArray:responseDic[@"datas"]];
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSDetailContactModel *model = [[MSDetailContactModel alloc] init];
                model.name = [HDUtil check:dict[@"name"]];
                model.address = [HDUtil check:dict[@"projectNames"]];
                NSString *source = [HDUtil check:dict[@"source"]];
                if ([source isEqualToString:@"phoneBook"]) {
                    model.source = @"通讯录";
                }
                if ([source isEqualToString:@"projectContacts"]) {
                    model.source = @"项目联系人";
                }
                model.telephone = [HDUtil check:dict[@"mobile"]];
                
                [dataArray addObject:model];
            }
        }
        [userInfo setObject:[HDUtil check:responseDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:responseDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"MayKnowPerson"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 出售此联系人的人
- (void)requestSaleContactsOfPeopleWithTarget:(id)target hudView:(UIView *)hudView contactsId:(NSString *)contactsId params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:SaleContactsOfPeople,hostUrl,contactsId];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseSaleContactsOfPeopleRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析出售此联系人的人
-(void)responseSaleContactsOfPeopleRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"出售此联系人的人:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSDictionary *valueDic = responseDic[@"dealPage"];
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = @[];
        if ([valueDic isKindOfClass:[NSDictionary class]]) {
            tempArray = [HDUtil checkArray:valueDic[@"datas"]];
        }
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSDetailContactModel *model = [[MSDetailContactModel alloc] init];
                model.peopleId = [HDUtil check:dict[@"id"]];
                model.contactType = [HDUtil check:dict[@"typeName"]];
                model.name = [HDUtil check:dict[@"name"]];
                model.position = [HDUtil check:dict[@"position"]];
                model.company = [HDUtil check:dict[@"company"]];
                model.source = [HDUtil check:dict[@"remark"]];
                
                model.telephone = [HDUtil check:dict[@"mobile"]];
                model.address = [HDUtil check:dict[@"address"]];
                
                [dataArray addObject:model];
            }
        }
        [userInfo setObject:[HDUtil check:valueDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:valueDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"SaleContactsOfPeople"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 联系人纠错类型
- (void)requestContactsCorrectTypeWithTarget:(id)target hudView:(UIView *)hudView{
    NSString *currentStr = [NSString stringWithFormat:ContactsCorrectType,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseContactsCorrectTypeRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析联系人纠错类型
-(void)responseContactsCorrectTypeRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"联系人纠错类型:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        
        NSArray *contactsCorrectArray = [HDUtil checkArray:responseDic[@"correctionTypes"]];
        [userInfo setObject:contactsCorrectArray forKey:@"ContactsCorrectType"];
        self.contactsCorrectArray  = contactsCorrectArray;
        
        NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES) firstObject];
        NSString *contactsCorrectFile = [documentsPath stringByAppendingPathComponent:@"contactsCorrectFile.plist"];
        [contactsCorrectArray writeToFile:contactsCorrectFile atomically:YES];
        
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 联系人纠正
- (void)requestContactsCorrectWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ContactsCorrect,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self POST:urlStr parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseContactsCorrectRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析联系人纠正
-(void)responseContactsCorrectRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"联系人纠正:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"ContactsCorrect"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 搜索引荐人列表
- (void)requestRecommandListWithTarget:(id)target hudView:(UIView *)hudView keyword:(NSString *)keyword params:(NSDictionary *)params
{
    NSString *currentStr = [NSString stringWithFormat:RecommandList,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:params hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseRecommandListRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"RecommandList" forKey:@"RecommandList"];

        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析搜索引荐人列表
-(void)responseRecommandListRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"引荐列表:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSDictionary *valueDic = responseDic[@"projectContactsPage"];
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = @[];
        if ([valueDic isKindOfClass:[NSDictionary class]]) {
            tempArray = [HDUtil checkArray:valueDic[@"datas"]];
        }
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSDetailContactModel *model = [[MSDetailContactModel alloc] init];
                model.peopleId = [HDUtil check:dict[@"id"]];
                model.contactType = [HDUtil check:dict[@"typeName"]];
                model.name = [HDUtil check:dict[@"name"]];
                model.position = [HDUtil check:dict[@"position"]];
                model.company = [HDUtil check:dict[@"company"]];
                model.source = [HDUtil check:dict[@"source"]];
                
                model.telephone = [HDUtil check:dict[@"mobile"]];
                model.address = [HDUtil check:dict[@"address"]];
                
                [dataArray addObject:model];
            }
        }
        [userInfo setObject:[HDUtil check:valueDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:valueDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"RecommandList"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 项目足迹
- (void)requestProjectFooterWithTarget:(id)target hudView:(UIView *)hudView projectId:(NSString *)projectId params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ProjectFooter,hostUrl,projectId];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:params hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseMyFootRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"MyFoot" forKey:@"MyFoot"];

        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

#pragma mark - 交易筛选条件
- (void)requestTradeScreeningConditionsWithTarget:(id)target hudView:(UIView *)hudView{
    NSString *currentStr = [NSString stringWithFormat:TradeScreeningConditions,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseTradeScreeningConditionsRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析交易筛选条件
-(void)responseTradeScreeningConditionsRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"交易筛选条件:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"TradeScreeningConditions" forKey:@"TradeScreeningConditions"];
        NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES) firstObject];

        //省市
        NSArray *provincesArray = [HDUtil checkArray:responseDic[@"provinces"]];
        [userInfo setObject:provincesArray forKey:@"ProvinceAndCity"];
        self.provincesArray = provincesArray;
        NSString *provincesFile = [documentsPath stringByAppendingPathComponent:@"provincesFile.plist"];
        [provincesArray writeToFile:provincesFile atomically:YES];
        
        //类型
        NSArray *typeArray = [HDUtil checkArray:responseDic[@"types"]];
        self.tradeTypeArray = provincesArray;
        NSString *provincesFile2 = [documentsPath stringByAppendingPathComponent:@"tradeTypeFile.plist"];
        [typeArray writeToFile:provincesFile2 atomically:YES];
        
        //状态
        NSArray *stateArray = [HDUtil checkArray:responseDic[@"statuses"]];
        self.tradeStateArray = provincesArray;
        NSString *provincesFile3 = [documentsPath stringByAppendingPathComponent:@"tradeStateFile.plist"];
        [stateArray writeToFile:provincesFile3 atomically:YES];
        
        //行业
        NSArray *industrysArray = [HDUtil checkArray:responseDic[@"industrys"]];
        self.projectIndustryArray = industrysArray;
        NSString *projectIndustryFile4 = [documentsPath stringByAppendingPathComponent:@"projectIndustryFile.plist"];
        [industrysArray writeToFile:projectIndustryFile4 atomically:YES];
        
        //时间
        NSArray *timeArray = [HDUtil checkArray:responseDic[@"onlineTimes"]];
        self.projectTimeArray = timeArray;
        NSString *projectTimeFile5 = [documentsPath stringByAppendingPathComponent:@"projectTimeFile.plist"];
        [timeArray writeToFile:projectTimeFile5 atomically:YES];
        
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 项目交易列表
- (void)requestProjectTradeListWithTarget:(id)target hudView:(UIView *)hudView projectId:(NSString *)projectId params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ProjectTradeList,hostUrl,projectId];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:params hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseProjectTradeListRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ProjectTradeList" forKey:@"ProjectTradeList"];

        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析项目交易列表
-(void)responseProjectTradeListRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"项目交易列表:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSDictionary *valueDic = responseDic[@"dealPage"];
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = [HDUtil checkArray:valueDic[@"datas"]];
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSTradeModel *model = [[MSTradeModel alloc] init];
                model.itemId = [HDUtil check:dict[@"id"]];
                model.type = [HDUtil check:dict[@"type"]];
                model.typeGroup = [HDUtil check:dict[@"dealTypeGroup"]];
                model.title = [HDUtil check:dict[@"projectName"]];//@"上海浦东世和空港中心商业住房项目";
                model.projectType = [HDUtil check:dict[@"dealTypeName"]];//@"求购业主联系人信息";
                model.tradeState = [HDUtil check:dict[@"status"]];//@"交易中";
                model.tradeNum = [HDUtil check:dict[@"orderCnt"]];//@"3次交易";
                if ([model.typeGroup isEqualToString:@"contacts"]) {//联系人
                    model.name = [HDUtil check:dict[@"name"]];//@"周世鹏";
                    model.position = [HDUtil check:dict[@"position"]];//@"经理";
                    model.theme = [HDUtil check:dict[@"position"]];//@"电缆附件招标最新进展";
                    model.content = @"";//@"杭州地铁二号线目前极影施工阶段";
                }
                else{//项目
                    model.name = @"";//@"周世鹏";
                    model.position = @"";//@"经理";
                    model.theme = [HDUtil check:dict[@"name"]];//@"电缆附件招标最新进展";
                    model.content = [HDUtil check:dict[@"remark"]];//@"杭州地铁二号线目前极影施工阶段";
                }
                model.tradeEvaluate = [HDUtil check:dict[@"evaluateLevel"]];//@"评价              ";
                model.tradePrice = [HDUtil check:dict[@"price"]];//@"12";
                model.memberType = [HDUtil check:dict[@"leaguerName"]];//@"[匿名会员]";
                model.memberLevel = [HDUtil check:dict[@"bonusPoint"]];//@"2钻会员";
                NSString *timeStr = [HDUtil formatter:@"YYYY.MM.dd" FromeDateStr:[HDUtil check:dict[@"createDate"]]];
                model.time = timeStr;//@"2016.9.15";
                model.isSelf = [[HDUtil check:dict[@"meCreated"]] boolValue];
                [dataArray addObject:model];
            }
        }
        [userInfo setObject:[HDUtil check:valueDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:valueDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"ProjectTradeList"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 交易列表
- (void)requestTradeListWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:TradeList,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:params hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseTradeListRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"TradeList" forKey:@"TradeList"];

        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析交易列表
-(void)responseTradeListRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"交易列表:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSDictionary *valueDic = responseDic[@"dealPage"];
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = [HDUtil checkArray:valueDic[@"datas"]];
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSTradeModel *model = [[MSTradeModel alloc] init];
                model.itemId = [HDUtil check:dict[@"id"]];
                model.type = [HDUtil check:dict[@"type"]];
                model.typeGroup = [HDUtil check:dict[@"dealTypeGroup"]];
                model.title = [HDUtil check:dict[@"projectName"]];//@"上海浦东世和空港中心商业住房项目";
                model.projectType = [HDUtil check:dict[@"dealTypeName"]];//@"求购业主联系人信息";
                model.tradeState = [HDUtil check:dict[@"status"]];//@"交易中";
                model.tradeNum = [HDUtil check:dict[@"orderCnt"]];//@"3次交易";
                if ([model.typeGroup isEqualToString:@"contacts"]) {//联系人
                    model.name = [HDUtil check:dict[@"name"]];//@"周世鹏";
                    model.position = [HDUtil check:dict[@"position"]];//@"经理";
                    model.theme = [HDUtil check:dict[@"position"]];//@"电缆附件招标最新进展";
                    model.content = @"";//@"杭州地铁二号线目前极影施工阶段";
                }
                else{//项目
                    model.name = @"";//@"周世鹏";
                    model.position = @"";//@"经理";
                    model.theme = [HDUtil check:dict[@"name"]];//@"电缆附件招标最新进展";
                    model.content = [HDUtil check:dict[@"remark"]];//@"杭州地铁二号线目前极影施工阶段";
                }
                model.tradeEvaluate = [HDUtil check:dict[@"totalEvaluate"]];//@"评价              ";
                model.tradePrice = [HDUtil check:dict[@"price"]];//@"12";
                model.memberType = [HDUtil check:dict[@"leaguerName"]];//@"[匿名会员]";
                model.memberLevel = [HDUtil check:dict[@"bonusPoint"]];//@"2钻会员";
                NSString *timeStr = [HDUtil formatter:@"YYYY.MM.dd" FromeDateStr:[HDUtil check:dict[@"createDate"]]];
                model.time = timeStr;//@"2016.9.15";
                model.isSelf = [[HDUtil check:dict[@"meCreated"]] boolValue];
                [dataArray addObject:model];
            }
        }
        [userInfo setObject:[HDUtil check:valueDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:valueDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"TradeList"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 交易搜索联想
- (void)requestTradeSearchRelevanceWithTarget:(id)target hudView:(UIView *)hudView keyword:(NSString *)keyword params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:TradeSearchRelevance,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:params hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseTradeSearchRelevanceRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"TradeSearchRelevance" forKey:@"TradeSearchRelevance"];

        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析交易搜索联想
-(void)responseTradeSearchRelevanceRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"交易搜索联想:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSDictionary *valueDic = responseDic[@"dealPage"];
        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = @[];
        if ([valueDic isKindOfClass:[NSDictionary class]]) {
            tempArray = [HDUtil checkArray:valueDic[@"datas"]];
        }
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSTradeModel *model = [[MSTradeModel alloc] init];
                model.itemId = [HDUtil check:dict[@"id"]];
                model.type = [HDUtil check:dict[@"type"]];
                model.typeGroup = [HDUtil check:dict[@"dealTypeGroup"]];
                model.title = [HDUtil check:dict[@"projectName"]];//@"上海浦东世和空港中心商业住房项目";
                model.projectType = [HDUtil check:dict[@"dealTypeName"]];//@"求购业主联系人信息";
                model.tradeState = [HDUtil check:dict[@"status"]];//@"交易中";
                model.tradeNum = [HDUtil check:dict[@"orderCnt"]];//@"3次交易";
                if ([model.typeGroup isEqualToString:@"contacts"]) {//联系人
                    model.name = [HDUtil check:dict[@"name"]];//@"周世鹏";
                    model.position = [HDUtil check:dict[@"position"]];//@"经理";
                    model.theme = [HDUtil check:dict[@"position"]];//@"电缆附件招标最新进展";
                    model.content = @"";//@"杭州地铁二号线目前极影施工阶段";
                }
                else{//项目
                    model.name = @"";//@"周世鹏";
                    model.position = @"";//@"经理";
                    model.theme = [HDUtil check:dict[@"name"]];//@"电缆附件招标最新进展";
                    model.content = [HDUtil check:dict[@"remark"]];//@"杭州地铁二号线目前极影施工阶段";
                }
                model.tradeEvaluate = [HDUtil check:dict[@"evaluateLevel"]];//@"评价              ";
                model.tradePrice = [HDUtil check:dict[@"price"]];//@"12";
                model.memberType = [HDUtil check:dict[@"leaguerName"]];//@"[匿名会员]";
                model.memberLevel = [HDUtil check:dict[@"bonusPoint"]];//@"2钻会员";
                NSString *timeStr = [HDUtil formatter:@"YYYY.MM.dd" FromeDateStr:[HDUtil check:dict[@"createDate"]]];
                model.time = timeStr;//@"2016.9.15";
                model.isSelf = [[HDUtil check:dict[@"meCreated"]] boolValue];
                [dataArray addObject:model];
            }
        }
        [userInfo setObject:[HDUtil check:responseDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:responseDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"TradeSearchRelevance"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 出售列表
- (void)requestSaleListWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:SaleList,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:params hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseSaleListRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"SaleList" forKey:@"SaleList"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析出售列表
-(void)responseSaleListRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"出售列表:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSDictionary *valueDic = responseDic[@"dealPage"];

        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = [HDUtil checkArray:valueDic[@"datas"]];
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSTradeModel *model = [[MSTradeModel alloc] init];
                model.itemId = [HDUtil check:dict[@"id"]];
                model.type = @"出售";//[HDUtil check:dict[@"type"]];
                model.typeGroup = [HDUtil check:dict[@"dealTypeGroup"]];
                model.title = [HDUtil check:dict[@"projectName"]];//@"上海浦东世和空港中心商业住房项目";
                model.projectType = [HDUtil check:dict[@"dealTypeName"]];//@"求购业主联系人信息";
                model.tradeState = [HDUtil check:dict[@"status"]];//@"交易中";
                model.tradeNum = [HDUtil check:dict[@"orderCnt"]];//@"3次交易";
                if ([model.typeGroup isEqualToString:@"contacts"]) {//联系人
                    model.name = [HDUtil check:dict[@"name"]];//@"周世鹏";
                    model.position = [HDUtil check:dict[@"position"]];//@"经理";
                    model.theme = [HDUtil check:dict[@"position"]];//@"电缆附件招标最新进展";
                    model.content = @"";//@"杭州地铁二号线目前极影施工阶段";
                }
                else{//项目
                    model.name = @"";//@"周世鹏";
                    model.position = @"";//@"经理";
                    model.theme = [HDUtil check:dict[@"name"]];//@"电缆附件招标最新进展";
                    model.content = [HDUtil check:dict[@"remark"]];//@"杭州地铁二号线目前极影施工阶段";
                }
                model.tradeEvaluate = [HDUtil check:dict[@"evaluateLevel"]];//@"评价              ";
                model.tradePrice = [HDUtil check:dict[@"price"]];//@"12";
                model.memberType = [HDUtil check:dict[@"leaguerName"]];//@"[匿名会员]";
                model.memberLevel = [HDUtil check:dict[@"bonusPoint"]];//@"2钻会员";
                NSString *timeStr = [HDUtil formatter:@"YYYY.MM.dd" FromeDateStr:[HDUtil check:dict[@"createDate"]]];
                model.time = timeStr;//@"2016.9.15";
                model.isSelf = [[HDUtil check:dict[@"meCreated"]] boolValue];
                model.isEvaluate = [[HDUtil check:dict[@"meEvaluated"]] boolValue];
                model.isComplete = [[HDUtil check:dict[@"canUpdate"]] boolValue];
                [dataArray addObject:model];
            }
        }
        [userInfo setObject:[HDUtil check:valueDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:valueDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"SaleList"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 购买列表
- (void)requestBuyListWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:BuyList,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:params hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseBuyListRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"BuyList" forKey:@"BuyList"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }];
}

//解析购买列表
-(void)responseBuyListRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"购买列表:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"ok" forKey:@"state"];
        NSDictionary *valueDic = responseDic[@"dealPage"];

        NSMutableArray *dataArray = [[NSMutableArray alloc] initWithCapacity:0];
        NSArray *tempArray = [HDUtil checkArray:valueDic[@"datas"]];
        for (NSDictionary *dict in tempArray ) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                MSTradeModel *model = [[MSTradeModel alloc] init];
                model.itemId = [HDUtil check:dict[@"id"]];
                model.type = @"购买";//[HDUtil check:dict[@"type"]];
                model.typeGroup = [HDUtil check:dict[@"dealTypeGroup"]];
                if ([model.typeGroup isEqualToString:@"contacts"]) {//联系人
                    model.name = [HDUtil check:dict[@"name"]];//@"周世鹏";
                    model.position = [HDUtil check:dict[@"position"]];//@"经理";
                    model.theme = [HDUtil check:dict[@"position"]];//@"电缆附件招标最新进展";
                    model.content = @"";//@"杭州地铁二号线目前极影施工阶段";
                }
                else{//项目
                    model.name = @"";//@"周世鹏";
                    model.position = @"";//@"经理";
                    model.theme = [HDUtil check:dict[@"name"]];//@"电缆附件招标最新进展";
                    model.content = [HDUtil check:dict[@"remark"]];//@"杭州地铁二号线目前极影施工阶段";
                }
                model.title = [HDUtil check:dict[@"projectName"]];//@"上海浦东世和空港中心商业住房项目";
                model.projectType = [HDUtil check:dict[@"dealTypeName"]];//@"求购业主联系人信息";
                model.tradeState = [HDUtil check:dict[@"status"]];//@"交易中";
                model.tradeNum = [HDUtil check:dict[@"orderCnt"]];//@"3次交易";
                
                model.tradeEvaluate = [HDUtil check:dict[@"evaluateLevel"]];//@"评价              ";
                model.tradePrice = [HDUtil check:dict[@"price"]];//@"12";
                model.memberType = [HDUtil check:dict[@"leaguerName"]];//@"[匿名会员]";
                model.memberLevel = [HDUtil check:dict[@"bonusPoint"]];//@"2钻会员";
                NSString *timeStr = [HDUtil formatter:@"YYYY.MM.dd" FromeDateStr:[HDUtil check:dict[@"createDate"]]];
                model.time = timeStr;//@"2016.9.15";
                model.isSelf = [[HDUtil check:dict[@"meCreated"]] boolValue];
                model.isEvaluate = [[HDUtil check:dict[@"meEvaluated"]] boolValue];
                model.isComplete = [[HDUtil check:dict[@"canUpdate"]] boolValue];
                [dataArray addObject:model];
            }
        }
        [userInfo setObject:[HDUtil check:valueDic[@"pageNo"]] forKey:@"pageNo"];
        [userInfo setObject:[HDUtil check:valueDic[@"totalPage"]] forKey:@"totalPage"];
        [userInfo setObject:dataArray forKey:@"BuyList"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 交易详情
- (void)requestTradeDetailWithTarget:(id)target hudView:(UIView *)hudView tradeId:(NSString *)tradeId{
    NSString *currentStr = [NSString stringWithFormat:TradeDetail,hostUrl,tradeId];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseTradeDetailRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析交易详情
-(void)responseTradeDetailRequest:(NSDictionary *)valueDic target:(id)target{
    if (![valueDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"交易详情:%@",valueDic);
    NSString *state = [HDUtil check:valueDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSDictionary *responseDic = valueDic[@"deal"];

        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        
        MSTradeModel *model = [[MSTradeModel alloc] init];
        model.title = [HDUtil check:responseDic[@"projectName"]];//@"上海浦东世和空港中心商业住房项目";
        model.projectType = [HDUtil check:responseDic[@"dealTypeName"]];//@"求购业主联系人信息";
        model.tradeState = [HDUtil check:responseDic[@"name"]];//@"交易中";
        model.tradeNum = [HDUtil check:responseDic[@"orderCnt"]];//@"3次交易";
        model.name = [HDUtil check:responseDic[@"name"]];//@"周世鹏";
        model.position = [HDUtil check:responseDic[@"position"]];//@"经理";
        model.theme = [HDUtil check:responseDic[@"name"]];//@"电缆附件招标最新进展";
        model.content = [HDUtil check:responseDic[@"remark"]];//@"杭州地铁二号线目前极影施工阶段";
        model.tradeEvaluate = [HDUtil check:responseDic[@"evaluateLevel"]];//@"评价              ";
        model.tradePrice = [HDUtil check:responseDic[@"price"]];//@"12";
        model.memberType = [HDUtil check:responseDic[@"leaguerName"]];//@"[匿名会员]";
        model.memberLevel = [HDUtil check:responseDic[@"name"]];//@"2钻会员";
        NSString *timeStr = [HDUtil formatter:@"YYYY.MM.dd" FromeDateStr:[HDUtil check:responseDic[@"createDate"]]];
        model.time = timeStr;//@"2016.9.15";
        model.getPrice = [HDUtil check:responseDic[@"price"]];
        model.wallet = [HDUtil check:valueDic[@"wallet"]];
        
        [userInfo setObject:model forKey:@"TradeDetail"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:valueDic[@"msg"]]];
    }
}

#pragma mark - 进行交易(出售)
- (void)requestSaleTradeWithTarget:(id)target hudView:(UIView *)hudView tradeId:(NSString *)tradeId params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:SaleTrade,hostUrl,tradeId];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self POST:urlStr parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseSaleTradeRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析进行交易(出售)
-(void)responseSaleTradeRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"进行交易(出售):%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"SaleTrade"];
        [userInfo setObject:[HDUtil check:responseDic[@"orderId"]] forKey:@"orderId"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 进行交易(求购联系人)
- (void)requestBuyTradeContactsWithTarget:(id)target hudView:(UIView *)hudView tradeId:(NSString *)tradeId params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:BuyTradeContacts,hostUrl,tradeId];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self POST:urlStr parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseBuyTradeContactsRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析进行交易(求购联系人)
-(void)responseBuyTradeContactsRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"进行交易(求购联系人):%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"BuyTradeContacts"];
        [userInfo setObject:[HDUtil check:responseDic[@"orderId"]] forKey:@"orderId"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 进行交易(求购项目进展)
- (void)requestBuyTradeProjectWithTarget:(id)target hudView:(UIView *)hudView tradeId:(NSString *)tradeId params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:BuyTradeProject,hostUrl,tradeId];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self POST:urlStr parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseBuyTradeProjectRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析进行交易(求购项目进展)
-(void)responseBuyTradeProjectRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"进行交易(求购项目进展):%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"BuyTradeProject"];
        [userInfo setObject:[HDUtil check:responseDic[@"orderId"]] forKey:@"orderId"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 交易评价
- (void)requestTradeEvaluateWithTarget:(id)target hudView:(UIView *)hudView orderId:(NSString *)orderId params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:TradeEvaluate,hostUrl,orderId];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self POST:urlStr parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseTradeEvaluateRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析交易评价
-(void)responseTradeEvaluateRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"交易评价:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"TradeEvaluate"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 交易类别
- (void)requestTradeKindWithTarget:(id)target hudView:(UIView *)hudView{
    NSString *currentStr = [NSString stringWithFormat:TradeKind,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseTradeKindRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析交易类别
-(void)responseTradeKindRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"交易类别:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        
        NSArray *tradeKindArray = [HDUtil checkArray:responseDic[@"dealTypes"]];
        [userInfo setObject:tradeKindArray forKey:@"TradeKind"];
        self.tradeKindArray  = tradeKindArray;
        
        NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES) firstObject];
        NSString *contactsCorrectFile = [documentsPath stringByAppendingPathComponent:@"tradeKindFile.plist"];
        [tradeKindArray writeToFile:contactsCorrectFile atomically:YES];
        
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }

}

#pragma mark - 交易类别价格
- (void)requestTradeKindPriceWithTarget:(id)target hudView:(UIView *)hudView{
    NSString *currentStr = [NSString stringWithFormat:TradeKindPrice,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self GET:urlStr parameters:nil hudView:hudView success:^(NSURLSessionDataTask *task, id responseObject) {
        [self responseTradeKindPriceRequest:responseObject target:target];
    } failure:^(NSURLSessionDataTask *task, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析交易类别价格
-(void)responseTradeKindPriceRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"交易类别价格:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        NSArray *resultArray = [HDUtil checkArray:responseDic[@"dealAvgPrices"]];
        MSTradeKindPrice *model = [[MSTradeKindPrice alloc] init];

        for (NSDictionary*dict in resultArray) {
            if ([dict isKindOfClass:[NSDictionary class]]) {
                NSString *code = [HDUtil check:dict[@"code"]];
                if ([code isEqualToString:@"contactsSellAvgPrice"]) {
                    model.saleContactPrice = [HDUtil check:dict[@"name"]];
                }
                if ([code isEqualToString:@"contactsSellAvgPrice"]) {
                    model.saleProjectPrice = [HDUtil check:dict[@"name"]];
                }
                if ([code isEqualToString:@"contactsBuyAvgPrice"]) {
                    model.buyContactPrice = [HDUtil check:dict[@"name"]];
                }
                if ([code isEqualToString:@"progressBuyAvgPrice"]) {
                    model.buyProjectPrice = [HDUtil check:dict[@"name"]];
                }
            }
        }
        
        [userInfo setObject:model forKey:@"TradeKindPrice"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
    
}

#pragma mark - 发布出售联系人
- (void)requestReleaseSaleContactsWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ReleaseSaleContacts,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self POST:urlStr parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseReleaseSaleContactsRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析发布出售联系人
-(void)responseReleaseSaleContactsRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"发布出售联系人:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"ReleaseSaleContacts"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 发布出售项目进展
- (void)requestReleaseSaleProjectWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ReleaseSaleProject,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self POST:urlStr parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseReleaseSaleProjectRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析发布出售项目进展
-(void)responseReleaseSaleProjectRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"发布出售项目进展:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"ReleaseSaleProject"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 发布求购联系人
- (void)requestReleaseBuyContactsWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ReleaseBuyContacts,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self POST:urlStr parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseReleaseBuyContactsRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析发布求购联系人
-(void)responseReleaseBuyContactsRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"发布求购联系人:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"ReleaseBuyContacts"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 发布求购项目进展
- (void)requestReleaseBuyProjectWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ReleaseBuyProject,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self POST:urlStr parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseReleaseBuyProjectRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析发布求购项目进展
-(void)responseReleaseBuyProjectRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"发布求购项目进展:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"ReleaseBuyProject"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 编辑出售联系人
- (void)requestEditSaleContactsWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ReleaseSaleContacts,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self PUT:urlStr parameters:nil hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseReleaseSaleContactsRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

#pragma mark - 编辑出售项目进展
- (void)requestEditSaleProjectWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ReleaseSaleProject,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self PUT:urlStr parameters:nil hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseReleaseSaleProjectRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

#pragma mark - 编辑求购联系人
- (void)requestEditBuyContactsWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ReleaseBuyContacts,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self PUT:urlStr parameters:nil hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseReleaseBuyContactsRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

#pragma mark - 编辑求购项目进展
- (void)requestEditBuyProjectWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:ReleaseBuyProject,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self PUT:urlStr parameters:nil hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseReleaseBuyProjectRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

#pragma mark - 创建项目
- (void)requestCreatProjectWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params{
    NSString *currentStr = [NSString stringWithFormat:CreatProject,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self POST:urlStr parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseCreatProjectRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析创建项目
-(void)responseCreatProjectRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"创建项目:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:[HDUtil check:responseDic[@"projectId"]] forKey:@"CreatProject"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 发布足迹
- (void)requestReleaseFooterWithTarget:(id)target hudView:(UIView *)hudView params:(NSDictionary *)params;{
    NSString *currentStr = [NSString stringWithFormat:ReleaseFooter,hostUrl];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self POST:urlStr parameters:params hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseReleaseFooterRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析发布足迹
-(void)responseReleaseFooterRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"发布足迹:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"ReleaseFooter"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 删除足迹
- (void)requestDeleteFooterWithTarget:(id)target hudView:(UIView *)hudView footerId:(NSString *)footerId{
    NSString *currentStr = [NSString stringWithFormat:DeleteFooter,hostUrl,footerId];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self DELETE:urlStr parameters:nil hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseDeleteFooterRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析删除足迹
-(void)responseDeleteFooterRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"删除足迹:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"DeleteFooter"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 好评足迹
- (void)requestGoodFooterWithTarget:(id)target hudView:(UIView *)hudView footerId:(NSString *)footerId{
    NSString *currentStr = [NSString stringWithFormat:GoodFooter,hostUrl,footerId];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self PUT:urlStr parameters:nil hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseGoodFooterRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析好评足迹
-(void)responseGoodFooterRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"好评足迹:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"GoodFooter"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}

#pragma mark - 差评足迹
- (void)requestBadFooterWithTarget:(id)target hudView:(UIView *)hudView footerId:(NSString *)footerId{
    NSString *currentStr = [NSString stringWithFormat:BadFooter,hostUrl,footerId];
    NSString *urlStr = [NSString stringWithFormat:@"%@;jsessionid=%@",currentStr,netEngine.sessionId];
    [self PUT:urlStr parameters:nil hudView:hudView success:^(AFHTTPRequestOperation *operation, id responseObject) {
        [self responseBadFooterRequest:responseObject target:target];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        [self showErrorMessge:error];
    }];
}

//解析差评足迹
-(void)responseBadFooterRequest:(NSDictionary *)responseDic target:(id)target{
    if (![responseDic isKindOfClass:[NSDictionary class]]) {
        return;
    }
    NSLog(@"差评足迹:%@",responseDic);
    NSString *state = [HDUtil check:responseDic[@"status"]];
    if ([state isEqualToString:@"ok"]) {
        NSMutableDictionary *userInfo =[NSMutableDictionary dictionaryWithObjectsAndKeys:target,Receiver,nil];
        [userInfo setObject:@"OK" forKey:@"BadFooter"];
        [[NSNotificationCenter defaultCenter] postNotificationName:MSViewControllerUpdateNotification object:self userInfo:userInfo];
    }
    else{
        [HDUtil showMessage:[HDUtil check:responseDic[@"msg"]]];
    }
}


















@end
